package ConCom.test1;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class ReduceTest extends Reducer<IntWritable, Text, Text, NullWritable> {
    Text head = new Text(Count.header);
    @Override
    protected void reduce(IntWritable key, Iterable<Text> values, Reducer<IntWritable, Text, Text, NullWritable>.Context context) throws IOException, InterruptedException {

        context.write(head, NullWritable.get());
        System.out.println("===删除的个数为:" + Count.count + "===");
        for (Text value : values) {
            context.write(value, NullWritable.get());
        }
    }
}
